﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="email.ascx.cs" Inherits="AnyOffice.general.mytable.email" %>
<div id="module_5"  style="position: relative;padding-bottom:10px;">
<table class="TableBlock" width="100%" cellspacing="0" cellpadding="2">
	<tr class="TableHeader">
		<td id="module_5_head" class="TableHeader" width="70%">
			<img src="/images/menu/email.gif" align="absMiddle"> 内部邮件
		</td>
		<td id="module_5_more" align="right">
			<div id="module_5_op" style="float:right;display:none;">&nbsp;<a id="module_5_url" href="#" onclick="_del('5');"><img border="0" src="/images/x.gif" alt="不显示该模块"></a></div>
	        <div style="float:right"><a href="/general/email/new.aspx">撰写</a>&nbsp;</div>		
		
		</td>
	</tr>
	<tr class="TableData" style="background:#FFFFFF url(/images/water/email.jpg) no-repeat bottom right">
		<td colspan="2" height="60">
	    	<div id="divEmail">
			<asp:Repeater id="rptEmail" runat="server" EnableViewState="False">		
				<ItemTemplate>
				·<a href="/general/email/inbox_read_email.aspx?email_id=<%#DataBinder.Eval(Container.DataItem,"EmailId")%>&box_id=<%#DataBinder.Eval(Container.DataItem,"BoxId")%>&page=1"><%#DataBinder.Eval(Container.DataItem,"Subject").ToString() == "" ? "[无主题]" : DataBinder.Eval(Container.DataItem,"Subject").ToString()%></a>
				<u title="部门：<%#DataBinder.Eval(Container.DataItem,"DeptName")%>" style="cursor:hand"><%#DataBinder.Eval(Container.DataItem,"UserName")%></u>
				<%# (Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"ReadFlag")) == false) ? "<img src=/images/email_new.gif alt=未读 align=absmiddle>" : ""%>
				<br>
				</ItemTemplate>				
			</asp:Repeater>
			<asp:Literal id="litEmail" runat="server"></asp:Literal>
			</div>
		</td>
	</tr>
</table>
</div>
<SCRIPT language="javascript">
CODE_IDSTR += "2,";
var timer_email = null;
var str_email = "";
function GetEmail()
{	
	if(timer_email != null)
		window.clearTimeout(timer_email);
		
	AnyOffice.general.mytable.AjaxMethods.GetEmail(CallBack_GetEmail);
	timer_email=setTimeout("GetEmail()",AJAX_INTERVAL*5);
}
function CallBack_GetEmail(res)
{	
	if (res.error != null)  
		return;	
	if(str_email != res.value)	
		document.getElementById('divEmail').innerHTML = res.value;
	str_email = res.value;
}
GetEmail();
</SCRIPT>

